package com.gc.gc.department.control;

import com.gc.gc.department.service.DepartmentService;
import com.gc.gc.mybatis.entity.PtDepartmentEntity;
import com.gc.gc.mybatis.entity.PtUserEntity;
import com.gc.gc.mybatis.flexigrid.PadingRstType;
import com.gc.gc.mybatis.flexigrid.PagingBean;
import com.gc.gc.user.entity.UserSearchEnity;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/department")
public class DepartmentContrller {
    private Logger logger =  LogManager.getLogger(this.getClass().getName());
    @RequestMapping("/departmentPage")
    public String dutyPage(){
        return "/department/departmentPage";
    }

    @Resource
    DepartmentService departmentService ;
    @RequestMapping("/getUserInfolistByPage")
    @ResponseBody
    public PadingRstType<PtDepartmentEntity> getUserInfolistByPage(PtDepartmentEntity search, PagingBean paging){
        logger.info(search);
        PadingRstType<PtDepartmentEntity> ptUserEntityPadingRstType = departmentService.DepartmentList(paging);
        return ptUserEntityPadingRstType;
    }


}
